Analog unit system

ABSTRACT

An analog unit system according to this invention comprises a first analog unit having first storage means for storing a first factory setting value and a first user setting value, second storage means for reading the first factory setting value and the first user setting value out of the first storage means and storing the setting values, operation means for calculating a second user setting value based on the first factory setting value and the first user setting value read out of the second storage means, and a second analog unit having third storage means for storing the second user setting value calculated by this operation means and thereby, adjustment and calibration of the user setting value can automatically be performed by simple manipulation with respect to the analog unit in which the user setting value is not set.

TECHNICAL FIELD

[0001] This invention relates to an analog unit, and particularly toautomatic calibration and adjustment of its parameter.

BACKGROUND ART

[0002] Units called an analog unit broadly are generally classified intoan A/D conversion unit and a D/A conversion unit.

[0003] The A/D conversion unit inputs a voltage or a current andconverts the voltage or the current into a digital output value.

[0004] The D/A conversion unit specifies a digital value and outputs avoltage or a current corresponding to its value.

[0005] In this description below, the case of the A/D conversion unit,namely the unit for making conversion from an analog value into adigital value will be described as the analog unit mainly.

[0006] Conventionally, at the time of adjustment or replacement, etc. ofthe A/D conversion unit, a professional engineer has performedcalibration manually every one channel. The channel means one functionalunit among plural A/D conversion circuits present in one A/D conversionunit and, for example, in the case of an A/D conversion unit forsequencer, A/D conversion circuits of four to eight channels are had inone unit.

[0007] The reason why the calibration is necessary is because A/Dconversion characteristics every channel differ. The reason why theconversion characteristics differ is because there are variations incharacteristics in individual parts forming the A/D conversion circuit.

[0008] The calibration of the A/D conversion unit means that adjustmentis made so as to output a particular digital output value when a certainanalog value such as a voltage or a current is inputted.

[0009] A unit in which, for example, 0 to 10 V is inputted and a digitalvalue of 0 to 4000 is outputted as the A/D conversion unit is taken asan example.

[0010] First, an analog unit system acting as a part of, for example, aconventional FA system and a flow of a signal in its system are shown inFIG. 13. In the following description, the case that an analog inputsignal is a voltage is assumed, but the case of a current is alsosimilar.

[0011] In FIG. 13, an A/D conversion unit (hereinafter written as a unitproperly) 104 is a unit for inputting an analog signal and outputting adigital signal. A central control unit 5 such as a sequencer controlsthe entire FA system including the A/D conversion unit 104. Temporarymemory 6 of the inside of the central control unit 5 has sequenceprogram memory 6 a for holding a sequence program for control and devicememory 6 b for holding, namely storing other data (for example, adigital output value outputted from the A/D conversion unit 104).

[0012] An A/D conversion circuit 1 in the A/D conversion unit 104 inputsan analog signal from the outside and converts the analog signal into adigital signal (ADC code) to produce an output.

[0013] Scaling means 2 makes conversion from the inputted ADC code intoa digital value of an easy-to-process form. For example, when a digitaloutput value with an input of 1 to 5 V wants to be outputted in therange of 0 to 4000, a digital output value corresponding to the presentvoltage is outputted from an ADC code at the time of 1 V as an offsetvoltage, an ADC code at the time of 5 V as a gain voltage and an ADCcode of the voltage inputted at present.

[0014] Nonvolatile memory 3 stores an ADC code at the time of applyingthe offset voltage and an ADC code at the time of applying the gainvoltage, and sees the scaling means 2 at the time of performing scalingprocessing.

[0015] As shown in FIG. 13, the A/D conversion unit 104 normally has theA/D conversion circuit 1 and the scaling means 2, and preserves afactory offset value Fo, a factory gain value Fg set in a factory at thetime of production of the A/D conversion units and a user offset valueUo, a user gain value Ug set in the field in which a user uses in thenonvolatile memory 3 as an ADC code (hereinafter written as an offsetvalue properly) outputted at the time of applying the lowest offsetvoltage of specifications used in scaling and an ADC code (hereinafterwritten as a gain value properly) outputted at the time of applying thehighest gain voltage, and by the scaling means 2, the offset values andthe gain values are outputted to digital values of 0 to 4000 and areheld in the device memory 6 b in the temporary memory 6 of the centralcontrol unit 5 and are seen at the time of some processing of the systemaccording to the sequence program 6 a.

[0016] Here, an offset voltage and a gain voltage are defined. Theoffset voltage means a value of the lowest voltage of voltages inputtedin a particular channel of the A/D conversion unit and an input voltagein which the lowest value, for example, an output value 0 of the case ofbeing scaled from 0 to 4000 is outputted as a digital output value incorrespondence with the input voltage value. The gain voltage means avalue of the highest voltage of voltages inputted in the particularchannel and an input voltage in which the highest value, for example, anoutput value 4000 of the case of being scaled from 0 to 4000 isoutputted as a digital output value in correspondence with the inputvoltage value.

[0017] That is, when a range of the inputted voltage is 0 to 5 V, theoffset voltage becomes 0 V and the gain voltage becomes 5 V.

[0018] Here, the scaling means 2 will be described. In the scaling means2, an ADC code Iadc in proportion to a voltage applied to the A/Dconversion circuit 1 is received as an input value and the user offsetvalue Uo and the user gain value Ug are seen from the nonvolatile memory3. Further, the minimum value and the maximum value at the time ofscaling and output are set to So and Sg, respectively. A digital outputvalue Sd outputted from the scaling means 3 is obtained by the followingformula.

Sd=(Iadc−Uo)/(Ug−Uo)*Sg+So  formula (1)

[0019] However, in the formula (1) described above, Uo is a user offsetvalue and Ug is a user gain value and Iadc is a value (ADC code)outputted from the A/D conversion circuit and Sd is a value (digitaloutput value) after scaling calculation and Sg is the maximum value atthe time of scaling (Sg+So is the maximum value when So is not 0) and Sois the minimum value at the time of scaling, respectively.

[0020] Generally, in a scaling range (for example, 0 to 4000), theminimum value is 0, so that the value Sd is obtained by the followingformula excluding a term of So from the formula (1).

Sd=(Iadc−Uo)/(Ug−Uo)*Sg  formula (2)

[0021] By this formula (2), when an input voltage is an offset voltage,an ADC code is Uo, so that the first term becomes 0 and the minimumvalue So at the time of scaling becomes the digital output value. Whenan input voltage is a gain voltage, an ADC code is Ug, so that the firstterm becomes 1 and Sg becomes the digital output value.

[0022] That is, the first term shows a value of 0 to 1 when the ADC codeis in the range of Uo to Ug, and by multiplying this by Sg, linearconversion is implemented.

[0023] For example, in an apparatus shown in FIG. 13, in the case ofoutputting a digital output value of 0 to 4000, when it is assumed thatUo is 890 and Ug is 4050 and an ADC code inputted is 1680, a digitaloutput value to be outputted is as follows in the case of doingcalculation using the formula (5) described above.

(1680−890)/(4050−890)*4000=1000

[0024] The reason why the scaling means 2 is necessary is becauseindividual A/D conversion circuits 1 have variations in characteristicsand the variations are absorbed. For example, when a channel 1 in whichan ADC code outputted at the time of applying a voltage outputs 100 inthe case of applying 0 V and outputs 8000 in the case of applying 10 Vand a channel 2 in which the ADC code outputs 105 in the case ofapplying 0 V and outputs 8020 in the case of applying 10 V are present,an offset value and a gain value of the channel 1 are set to 100 and8000 and an offset value and a gain value of the channel 2 are set to105 and 8020 and scaling of 0 to 4000 is performed and thereby, adigital output value of 0 is outputted when an offset voltage of 0 V isapplied to any of the channels and a digital output value of 4000 isoutputted when a gain voltage of 10 V is applied. That is, thevariations in characteristics of individual A/D conversion circuits canbe absorbed by the scaling processing.

[0025] In order to perform this scaling processing and absorb thevariations, it is necessary to measure the characteristics of individualA/D conversion circuits and decide and preserve a user offset value, auser gain value.

[0026] Now, the case that, for example, an output from a variablevoltage generator 7 is inputted to the A/D conversion unit 104 as shownin FIG. 13 with respect to setting of the user offset value and the usergain value will be described.

[0027] A procedure manipulated by a user is shown in FIG. 14.

[0028] First, in step a1, the central control unit 5 is shifted to aSTOP state-by user instructions. Next, in step a2, the A/D conversionunit 104 is shifted to an offset and gain setting mode by userinstructions. When the A/D conversion unit 104 shifts to the offset andgain setting mode, in step a3, a user manipulates the variable voltagegenerator 7 and applies an offset voltage.

[0029] In the inside of the unit 104, the offset voltage is received andis inputted to the A/D conversion circuit 1 to output a correspondingADC code.

[0030] Then, in step a4, a user offset value is set by userinstructions. In the inside of the unit 104, the ADC code outputted atpresent is written into an area corresponding to a user offset value Uoof the nonvolatile memory 3.

[0031] Then, in step a5, the user manipulates the variable voltagegenerator 7 and applies a gain voltage. At this time, in the inside ofthe unit, the gain voltage is received and is inputted to the A/Dconversion circuit 1 to output a corresponding ADC code.

[0032] In the inside of the unit 104, the ADC code outputted at presentis written into an area corresponding to a user gain value Ug of thenonvolatile memory 3 (step a6).

[0033] The above manipulations are repeated by the number of channelspresent inside the A/D conversion unit 104 (step a7).

[0034] When setting of all the channels is completed, the A/D conversionunit 104 is shifted to a normal mode by user instructions (step a8). Bybeing shifted to the normal mode, in the inside of the unit 104, theuser offset value and the user gain value set newly are seen and scalingprocessing is performed and a digital output value as set can beoutputted.

[0035] Then, in step a9, the entire system operates again by shiftingthe central control unit 5 to a RUN state by user instructions.

[0036] In the conventional adjustment and calibration work describedabove, analog-to-digital conversion characteristics every channel differat the time of unit adjustment, so that it was necessary for aprofessional engineer to make adjustment by switch manipulationsmanually every one channel and the work was work in which themanipulations are also troublesome and a lot of time is expended.

[0037] Also, at the time of unit replacement etc. in operation of an FAsystem after incorporating the unit into the FA system once, there wereoften cases that a professional engineer for unit adjustment is absentin the vicinity of the field of installation and in the case that ageneral user makes adjustment and calibration, efficiency was bad andaccurate adjustment was difficult.

[0038] Also, during the adjustment and calibration, it was necessary tostop the FA system all over or over a considerably wide extent and therewas also fear that damage associated with the stop of the FA systembecomes large.

[0039] Therefore, this invention is implemented to solve the problems asdescribed above, and an object of the invention is to provide an analogunit in which at the time of unit adjustment etc., a stop of a systemsuch as an FA system is limited to a part and the entire system is notstopped and a user (operator) performs adjustment and calibration of anactually used user offset value and a user gain value of a unitautomatically and speedily by simple manipulation without expertise andcan adjust the actually used user offset value and the user gain valueof the unit in a short time and also at the time of unit replacementetc., adjustment and calibration of a new unit are performedautomatically and speedily and contribution to an increase in operatingefficiency of the entire system can be made.

DISCLOSURE OF THE INVENTION

[0040] This invention provides an analog unit system including a firstanalog unit having first storage means for storing a first factorysetting value and a first user setting value, and second storage meansfor reading the first factory setting value and the first user settingvalue out of the first storage means and storing the setting values.

[0041] Therefore, at the time of analog unit adjustment etc., the firstfactory setting value and the first user setting value stored in thefirst storage means of the first analog unit can be stored in theseparate second storage means, and the first factory setting value andthe first user setting value can be utilized through the second storagemeans regardless of a state of the first analog unit.

[0042] Also, this invention provides an analog unit system including afirst analog unit having first storage means for storing a first factorysetting value and a first user setting value, second storage means forreading the first factory setting value and the first user setting valueout of the first storage means and storing the setting values, operationmeans for calculating a second user setting value based on the firstfactory setting value and the first user setting value read out of thesecond storage means, and a second analog unit having third storagemeans for storing the second user setting value calculated by thisoperation means.

[0043] Therefore, adjustment and calibration of the user setting valuecan automatically be performed by simple manipulation with respect tothe analog unit in which the user setting value is not set, and also atthe time of replacement etc. of the analog unit, adjustment andcalibration of a new analog unit can automatically be performed, andfurther at the time of this adjustment and calibration, adjustment andcalibration of the analog unit system of a target can be performedwithout stopping the entire system, so that operating efficiency of theentire analog unit system can be increased.

[0044] Also, this invention provides an analog unit system in whichthere are a plurality of second analog units and a second user settingvalue is supplied to this plurality of second analog units in a batchmanner.

[0045] Therefore, in the case etc. of mounting plural A/D conversionunits into one analog unit system and making user range setting of thesame contents in large amounts, the user range setting can be madesimultaneously in a batch manner with respect to the plural A/Dconversion units, and a reduction in time and laborsaving of user rangesetting work of the entire analog unit system can be achieved. This hasthe large effect as the system with a large number of A/D conversionunits becomes large.

BRIEF DESCRIPTION OF THE DRAWINGS

[0046]FIG. 1 is a block diagram showing an analog unit system accordingto a first embodiment of this invention.

[0047]FIG. 2 is a flowchart showing a procedure of user range savingaccording to the first embodiment of this invention.

[0048]FIG. 3 is a flowchart showing a procedure of user rangerestoration according to the first embodiment of this invention.

[0049]FIGS. 4A and 4B are graphs showing a relation between an offsetvoltage, a gain voltage inputted and an offset value, a gain value.

[0050]FIG. 5 is a diagram showing a relation of offset values and gainvalues between two units.

[0051]FIG. 6 is a graph schematized in order to compare errorsrespectively included in two kinds of mathematical formulas.

[0052]FIG. 7 is a graph schematized in order to compare errorsrespectively included in two kinds of mathematical formulas.

[0053]FIG. 8 is a block diagram showing an analog unit system includingplural A/D conversion units according to the first embodiment of thisinvention.

[0054]FIG. 9 is a flowchart showing a setting procedure of an offsetvalue and a gain value in the system shown in FIG. 8.

[0055]FIG. 10 is a block diagram showing an analog unit system includingplural A/D conversion units according to a second embodiment of thisinvention.

[0056]FIG. 11 is a flowchart showing a replacement procedure of the A/Dconversion unit according to the second embodiment of this invention.

[0057]FIG. 12 is a block diagram showing an analog unit system includingplural A/D conversion units according to a third embodiment of thisinvention.

[0058]FIG. 13 is a block diagram showing a conventional analog unitsystem.

[0059]FIG. 14 is a flowchart showing a conventional setting procedure ofan offset value and a gain value.

BEST MODE FOR CARRYING OUT THE INVENTION First Embodiment

[0060] Preferred embodiments of this invention will be described usingthe drawings. FIG. 1 is a block diagram showing an analog unit systemaccording to a first embodiment of this invention. Main components inthe drawing will be described briefly.

[0061] An A/D conversion circuit 1 converts an analog input signal intoan ADC code. Scaling means 2 converts the ADC code into a digital outputvalue.

[0062] Nonvolatile memory 3 holds a user offset value, a user gainvalue, a factory offset value and a factory gain value seen by thescaling means 2.

[0063] Saving range selection means 9 selects which range is saved whensaving is instructed. Restoration range selection means 10 selects whichrange is restored when restoration is instructed.

[0064] An input range means a range of an analog value available in onechannel of an A/D conversion unit and is shown by an offset voltage anda gain voltage. For example, in the case of an input range of a range of0 to 5 V, an offset value becomes 0 V and a gain value becomes 5 V.

[0065] Offset correction formula selection means 11 selects which offsetcorrection formula is used when restoration is instructed. Gaincorrection formula selection means 12 selects which gain correctionformula is used when restoration is instructed.

[0066] First offset correction calculation means 13 a and second offsetcorrection calculation means 13 b respectively correct and calculate auser offset value Uor present in the channel of the unit from a factoryoffset value Fo, a factory gain value Fg, a user offset value Uo of asuccession origin and a factory offset value For, a factory gain valueFgr held in the nonvolatile memory 3 when restoration is instructed.

[0067] First gain correction calculation means 14 a and second gaincorrection calculation means 14 b respectively correct and calculate auser gain value Ugr present in the channel of the unit from a factoryoffset value Fo, a factory gain value Fg, a user gain value Ug of arestoration origin and a factory offset value For, a factory gain valueFgr held in the nonvolatile memory 3 when restoration is instructed.

[0068] In a manner similar to a conventional A/D conversion unit 104, anA/D conversion unit 4 according to this embodiment has the A/Dconversion circuit 1, the scaling means 2 and the nonvolatile memory 3,and a digital output value is held in device memory 6 b in temporarymemory 6 of a central control unit 5 such as a sequencer.

[0069] Incidentally, in the nonvolatile memory 3, unit uniqueinformation 3 a is recorded by one per unit and range settinginformation 3 b is recorded by the number of ranges capable of selectionand setting to one channel and a factory offset value Fo, a factory gainvalue Fg, a user offset value Uo and a user gain value Ug are recordedby the number of input ranges by the number of channels.

[0070] The unit unique information 3 a is information for identifyingmodels of the central control unit 5 and a unit present on the system byallocating the same numeric value to the same model and allocating adifferent numeric value to a different model, for example, 1 for a modelA and 2 for a model B.

[0071] In the range setting information 3 b, unique numeric values areallocated by the number of input ranges capable of selection and settingto one channel. Normally, the numeric values are serial numbers startingfrom 0 or 1. In the serial numbers, for example, a range of 0 to 10 V isallocated to 0 and a range of 1 to 5 V is allocated to 1 and a range of0 to 5 V is allocated to 2.

[0072] In the A/D conversion unit 4 according to this embodiment, a unitA in which a user offset value and a user gain value are set already andan unit B in which the values are not set yet are prepared.

[0073]FIG. 2 is a flowchart showing a procedure of user range saving.Incidentally, for simplification of description, in the flowchart ofFIG. 2, items such as updating of a range No. or the number of channelsto be naturally processed are omitted from the flowchart.

[0074] In order to save, that is, move and store user range setting of auser offset value, a user gain value, etc. which are ADC codes from anA/D conversion unit 4 a (unit A) in which the user offset value and theuser gain value are set already to the temporary memory 6 of the centralcontrol unit 5, in FIG. 2, in step b1, a user first makes a user rangesaving request via the central control unit 5. In this case, forexample, a saved channel and a range No. are held as an argument withrespect to a device (memory in which both of the A/D conversion unit andthe central control unit 5 can perform readout and writing) capable ofholding a numeric value present in the A/D conversion unit 4 a. Next, instep b2, the A/D conversion unit 4 receives a trigger of user rangesaving from the central control unit 5 in order to provide timing of astart of saving processing. Then, in step b3, the unit uniqueinformation 3 a is first saved to the temporary memory 6 of the centralcontrol unit 5. This processing is performed to prevent writing of thewrong user range in error in the case of mounting a unit of the wrongother model at the time of user range restoration.

[0075] Then, in step b4, by the saving range selection means 9, thesaved channel and the range No. held by a procedure of step b1 are seenand a saved range is selected and is saved to the temporary memory 6 ofthe central control unit 5. Saved data is a factory offset value Fo, afactory gain value Fg, a user offset value Uo, a user gain value Ug ofthe corresponding range and the range No. The reason why the range No.is included in the saved data is because all the input range data had bythe unit are not saved and data is limited to only an input rangenecessary actually and the amount of transfer data is minimized.

[0076] Then, in step b5, it is decided whether or not data is saved bythe number of necessary input ranges. This is because only datacorresponding to the necessary input range is saved. When the necessaryinput range remains still, processing from step b4 is continued.

[0077] Then, in step b6, it is determined whether or not data is savedby the number of necessary channels. When it is not performed by thenumber of channels yet, processing from step b4 is continued. Then, instep b7, the A/D conversion unit 4 a returns a status of the user rangesaving processing end to the central control unit 5.

[0078] Finally, in step b8, the user sees a status of the user rangesaving completion from the central control unit 5 and checks thecompletion of user range saving.

[0079] By the above processing, saving of the user range is executed andthe unit unique information from the A/D conversion unit 4 a, rangeinformation 1 to n and information necessary to restore the user rangeare held in the device memory 6 b of the central control unit 5.

[0080]FIG. 3 is a flowchart showing a procedure of user rangerestoration. Incidentally, for simplification of description, in theflowchart of FIG. 3, items such as updating of a range No. or the numberof channels to be naturally processed are omitted from the flowchart.Here, it is assumed that setting and storing of a user range into an A/Dconversion unit with no setting is called restoration.

[0081] In the following description, r is added to all the ends of afactory offset value For, a factory gain value Fgr, a user offset valueUor, a user gain value Ugr held in the nonvolatile memory 3 of an A/Dconversion unit 4 b (unit B) in which a user range is restored for thepurpose of distinguishing from data saved, namely previously stored inthe temporary memory 6 etc.

[0082] Incidentally, the factory offset value For and the factory gainvalue Fgr are preset uniquely to the A/D conversion unit 4 b.

[0083] In order to restore a user offset value to the A/D conversionunit 4 b in which a user offset value and a user gain value are not set,in FIG. 3, in step c1, a user first makes a user range restorationrequest via the central control unit 5. In this case, for example, saveddata is set to an argument with respect to a device (memory in whichboth of the A/D conversion unit 4 b and the central control unit 5 canperform readout and writing) capable of holding a numeric value presentin the A/D conversion unit 4 b. Next, in step c2, the A/D conversionunit 4 b receives a trigger of user range restoration from the centralcontrol unit 5 such as a sequencer in order to provide timing of a startof restoration processing. Then, in step c3, the A/D conversion unit 4 bfirst reads out the unit unique information 3 a previously stored in thetemporary memory 6 of the central control unit 5. Then, in step c4, theA/D conversion unit 4 b reads out and compares unit unique informationstored in the device memory 6 b saved similarly with unit uniqueinformation stored in the side of A/D conversion unit 4 b and therebydecides whether or not both the unit unique information match. When boththe unit unique information differ, a user range of the unit of adifferent model attempts to be restored, so that in this case, theflowchart proceeds to step c18 and the A/D conversion unit 4 b executesreturn of an error status of the user range restoration processing endto the central control unit 5 and subsequently in step c19, the usersees a status of the user range restoration completion from the centralcontrol unit 5 and checks the completion of restoration processing.

[0084] In the case of mounting the unit of a different model, thecompletion is reached without executing the restoration processing, sothat when necessary, the user mounts an exact A/D conversion unit to berestored in the system and thereafter again performs a procedure of userrange restoration from the beginning (step c1).

[0085] On the other hand, when the unit unique information stored in theside of the central control unit 5 matches with the unique informationstored in the side of A/D conversion unit 4 b and is exact in step c4,the flowchart proceeds to step c5 and by the restoration range selectionmeans 10, an input range restored is selected and Fo, Fg, Uo, Ugcompatible with corresponding input ranges are fetched from thetemporary memory 6 of the central control unit 5 and also For and Fgr ofcorresponding ranges are fetched from the nonvolatile memory 3 of theA/D conversion unit 4 b.

[0086] Then, in step c6, the offset correction formula selection means11 sees a factory offset value Fo, a factory gain value Fg, a useroffset value Uo, a user gain value Ug and selects more proper means asto which of the first offset correction calculation means 13 a or thesecond offset correction calculation means 13 b is used.

[0087] In this processing, in order to minimize an error included in aresultant user offset value Uor, the offset correction formula selectionmeans 11 selects the optimum offset correction calculation means. As towhich offset correction calculation means is selected, detaileddescription will be made below.

[0088] Then, in step c7, the offset correction formula selection means11 decides whether the first offset correction calculation means 13 a isused or not and when it is used, the flowchart proceeds to step c8 andUor is obtained by the first offset correction calculation means 13 a.When the first offset correction calculation means 13 a is not used, theflowchart proceeds to step c9 and Uor is obtained by the second offsetcorrection calculation means 13 b. As to how to obtain the user offsetvalue Uor, description will be made below.

[0089] Then, in step c10, the gain correction selection means 12 selectsmore proper means as to which of the first gain correction calculationmeans 14 a or the second gain correction calculation means 14 b is usedby the gain correction formula selection means 12. In this processing,the optimum gain correction means is selected in order to minimize anerror included in a user gain value Ugr in a manner similar to theprocessing in step c6.

[0090] Then, in step c11, the gain correction formula selection means 12decides whether the first gain correction calculation means 14 a is usedor not and when the first gain correction calculation means 14 a isused, the flowchart proceeds to step c12 and Ugr is obtained by thefirst gain correction calculation means 14 a. On the other hand, whenthe first gain correction calculation means 14 a is not used, theflowchart proceeds to step c13 and Ugr is obtained by the second gaincorrection calculation means 14 b. As to how to obtain the user gainvalue Ugr, description will be made below.

[0091] Then, in step c14, the obtained Uor, Ugr are written into acorresponding address in the nonvolatile memory 3 of the A/D conversionunit 4 b.

[0092] Then, in step c15, the A/D conversion unit 4 b decides whether ornot it is restored by the number of necessary input ranges and when thenecessary input range remains still, processing from step c5 iscontinued.

[0093] When all the necessary input ranges have already been processed,the A/D conversion unit 4 b decides whether or not it is restored by thenumber of necessary channels (step c16) and when the necessary channelremains still, also in this case, processing from step c5 is continued.

[0094] When all is ended, in step c17, the A/D conversion unit 4 breturns a status of the user range restoration processing end to thecentral control unit 5.

[0095] Then, in step c19, the user sees a status of the user rangerestoration completion from the central control unit 5 and checks thecompletion of user range restoration.

[0096] By a series of the above processing, restoration of the userrange is executed and the user offset Uor and the user gain Ugr are heldin the nonvolatile memory 3 of the A/D conversion unit 4 b andsubsequently, the Uor, Ugr are seen and the scaling means 2 isprocessed.

[0097] Next, a concrete calculation method of the user offset value Uorand the user gain value Ugr will be described.

[0098] A factory offset value Fo, a factory gain value Fg, a user offsetvalue Uo and a user gain value Ug of the A/D conversion unit 4 a (unitA) saved to the central control unit 5 by the method shown in theprocedure of FIG. 2 are prepared. Further, a factory offset value Forand a factory gain value Fgr are prepared by the A/D conversion unit 4 b(unit B).

[0099] The Fo, Fg, Uo, Ug are present in the device memory 6 b of thecentral control unit 5, so that, for example, they are given to the A/Dconversion unit by performing writing with respect to a storage device(memory in which both of the A/D conversion unit and the central controlunit 5 can perform readout and writing) in the A/D conversion unit.

[0100] The For, Fgr are held in the nonvolatile memory 3 in the A/Dconversion unit for executing user range restoration, so that it isseen.

[0101] Since the factory offset value Fo, the factory gain value Fg ofthe A/D conversion unit 4 a (unit A) and the factory offset value For,the factory gain value Fgr of the A/D conversion unit 4 b (unit B) havethe same range setting set at the time of factory shipment, when thesame voltage is applied, the same value is outputted in a digital outputvalue outputted from the scaling means 2 finally. That is, when anoffset voltage is applied to the unit A, an ADC code outputted from theA/D conversion circuit 1 becomes Fo and when an offset voltage isapplied to the unit B, the ADC code becomes For. Similarly, when a gainvoltage is applied, an ADC code of Fg is outputted in the unit A and anADC code of Fgr is outputted in the unit B.

[0102] A ratio between an offset value, a gain value of factory settingand an offset value, a gain value of user setting is equal in the unit Aof a succession origin and the unit B of a succession destination, sothat a relation of the following formulas holds.

(Uo−Fo)/(Fg−Fo)=(Uor−For)/(Fgr−For)  formula (3)

(Ug−Fo)/(Fg−Fo)=(Ugr−For)/(Fgr−For)  formula (4)

[0103] When Uor, Ugr are obtained from here, the following formulas areacquired.

Uor=(Uo−Fo)*(Fgr−For)/(Fg−Fo)+For  formula (5)

Ugr=(Ug−Fo)*(Fgr−For)/(Fg−Fo)+For  formula (6)

[0104] That is, a user offset value and a user gain value unique to thesuccession destination unit, namely the unit B can be obtained bycorrection formulas shown in the formulas (5), (6) from the givenparameters Fo, Fg, Uo, Ug, For, Uor.

[0105] Or, since the following relation also holds,

(Fg−Uo)/(Fg−Fo)=(Fgr−Uor)/(Fgr−For)  formula (7)

(Fg−Ug)/(Fg−Fo)=(Fgr−Ugr)/(Fgr−For)  formula (8)

[0106] From here, Uor, Ugr can be obtained also in the followingformulas for obtaining Uor, Ugr.

Uor=Fgr−(Fg−Uo)*(Fgr−For)/(Fg−Fo)  formula (9)

Ugr=Fgr−(Fg−Ug)*(Fgr−For)/(Fg−Fo)  formula (10)

[0107] In order to obtain a user offset value Uor, Uor can be obtainedusing any of the formula (5) and the formula (9). Also, in order toobtain a user gain value Ugr, Ugr can be obtained using any of theformula (6) and the formula (10).

[0108] The formula (5), formula (6), formula (9) and formula (10)mentioned above will be described.

[0109]FIGS. 4A and 4B show a relation between an offset voltage, a gainvoltage and an offset value, a gain value by a graph.

[0110]FIGS. 4A and 4B are graphs in which an ADC code is taken as theaxis of ordinate and an analog input signal is taken as the axis ofabscissa. Here, in the analog input signal, a voltage is taken as anexample. The ADC code increases linearly as the voltage increases.

[0111] At the time of factory shipment, a factory offset voltage isapplied and an ADC code at that time is set to a factory offset valueFo. Also, an ADC code at the time of applying a factory gain voltage isset to a factory gain value Fg. In the case of this drawing, the factoryoffset voltage is set to 0 V and the factory gain voltage is set to 10V.

[0112] Also, an ADC code at the time when a user applies a user offsetvoltage in the field is set to a user offset value Uo, and an ADC codeat the time when the user applies a user gain voltage is set to a usergain value Ug. For the unit A, Fo, Fg, Uo, Ug are used and for the unitB, For, Fgr, Uor, Ugr are used. Further, in the case of obtaining thevalues Uor, Ugr of the unit B corresponding to Uo, Ug set in the unit A,a ratio between an offset value, a gain value of factory setting and anoffset value, a gain value of user setting is equal in the unit A of asuccession origin and the unit B of a succession destination, so thatthe following formulas are acquired.

(Uo−Fo)/(Fg−Fo)=(Uor−For)/(Fgr−For)  formula (11)

(Ug−Fo)/(Fg−Fo)=(Ugr−For)/(Fgr−For)  formula (12)

[0113] When Uor, Ugr are obtained, the following formulas are acquired.

Uor=(Uo−Fo)*(Fgr−For)/(Fg−Fo)+For  formula (5)

Ugr=(Ug−Fo)*(Fgr−For)/(Fg−Fo)+For  formula (6)

[0114] Also, from another proportional relation, Uor, Ugr can beobtained also in the following formulas.

Uor=Fgr−(Fg−Uo)*(Fgr−For)/(Fg−Fo)  formula (9)

Ugr=Fgr−(Fg−Ug)*(Fgr−For)/(Fg−Fo)  formula (10)

[0115] That is, the formula (5), formula (6), formula (9) and formula(10) described above can be obtained.

[0116] A relation of offset values and gain values between two units isshown in FIG. 5. In FIG. 5, ADC codes obtained at the time when afactory offset voltage, a factory gain voltage, a user offset voltage, auser gain voltage are applied between the units become values havingvariations depending on the units. However, its relative positionrelation is maintained. A user offset value Uor, a user gain value Ugrto be obtained can be obtained from this relative position relation.

[0117] Now, the fact that Uor can be obtained using any of the formula(5) and the formula (9) in order to obtain the user offset value Uor andUgr can be obtained using any of the formula (6) and the formula (10) inorder to obtain the user gain value Ugr has been described previously.

[0118] However, an ADC code obtained from the A/D conversion circuit 1includes an error unique to the circuit originally. This error resultsfrom variations in characteristics in individual parts forming the A/Dconversion circuit. In order to minimize an influence of this error, itis important to select which formula by which calculation is done.

[0119] Description of how the error originally included in the ADC codehas an influence at the time of scaling will be made before discussingthe errors of the formula (5), formula (6), formula (9) and formula(10).

[0120] In the formula (1) described above, an error δ (delta) isincluded in an ADC code obtained from the A/D conversion circuit 1.Thus, the formula (1) is changed to an formula to which δ is added asfollows.

Sd={(Iadc+|δa|)−(Uo+|δb|) }/{(Ug+|δC|)−(Uo+|δb|)*Sg+So  formula (13)

[0121] δa, δb, δC show errors included in Iadc, Uo, Ug, respectively.Since the errors cannot be subtracted mutually, when the errors areadded simply, the following formula is acquired.

Sd={(Iadc−Uo)+|δa+δb|}/{(Ug−Uo)+|δb+δC|}*Sg+So

[0122] When δa≈δb≈δC→δ is used, the following formula is acquired.

Sd={(Iadc−Uo)+2δ}/{(Ug−Uo+2δ)}*Sg+So

[0123] By 0>>δ, when δ of a denominator is omitted, the followingformula is acquired. $\begin{matrix}\begin{matrix}{{Sd} = {{{\left\{ {\left( {{Iadc} - {Uo}} \right) + {2\delta}} \right\}/\left( {{Ug} - {Uo}} \right)}*{Sg}} + {So}}} \\{= {{{\left\{ \left( {{Iadc} - {Uo}} \right) \right\}/\left( {{Ug} - {Uo}} \right)}*{Sg}} + {So} + {2{\delta/\left( {{Ug} - {Uo}} \right)}*{Sg}}}}\end{matrix} & {\quad {{formula}\quad (14)}}\end{matrix}$

[0124] That is, a term of “{(Iadc-Uo)}/(Ug−Uo)*Sg+So” is a true value,and “2δ/(Ug−Uo)*Sg” becomes an error propagated after scalingprocessing.

[0125] When the formula (5) which is an offset correction formula isevaluated in like manner, the following formula is acquired.$\begin{matrix}{{Uor} = {{\left\{ {\left( {{Uo} + {\delta \quad d}} \right) - \left( {{Fo} + {\delta \quad e}} \right)} \right\}*{\left\{ {\left( {{Fgr} + {\delta \quad f}} \right) - \left( {{For}\quad + {\delta g}} \right)} \right\}/\left\{ {\left( {{Fg} + {\delta \quad h}} \right) - \left( {{Fo} + {\delta \quad e}} \right)} \right\}}} + \left( {{For} + {\delta \quad g}} \right)}} & {{formula}\quad (15)}\end{matrix}$

[0126] δd, δe, δf, δh show errors included in Uo, Fo, Fgr, For, Fg,respectively. When δd≈δe≈δf≈δh→δ is used as the errors and similaroperation is performed, the following formula is acquired.

Uor=(Uo−Fo+2δ)*(Fgr−For+2δ)/(Fg−Fo+2δe)+For+δ

[0127] By 0>>δ, δ of a denominator is omitted. When δ2 is also omitted,the following formula is acquired.Uor = (Uo − Fo) * (Fgr − For)/(Fg − Fo) + For + 2δ{(Fgr − For) + (Uo − Fo)}/(Fg − Fo) + δ

[0128] By Fgr−For≈Fg−Fo, the following formula is acquired.$\begin{matrix}{{Uor} = {{\left( {{Uo} - {Fo}} \right)*{\left( {{Fgr} - {For}} \right)/\left( {{Fg} - {Fo}} \right)}} + {For} + {2{{{{\delta \left( {{Uo} - {Fo}} \right)}/\left( {{Fg} - {Fo}} \right)}{{{+ 3}{\delta }}}}}}}} & {{formula}\quad (16)}\end{matrix}$

[0129] That is, a term of “(Uo−Fo)*(Fgr−For)/(Fg−Fo)+For” is a truevalue, and “2|δ(Uo−Fo)/(Fg−Fo)|+3|δ|” becomes an error propagated at thetime of offset value correction.

[0130] Similarly, the formula (9) is as follows. $\begin{matrix}{{Uor} = {{Fgr} - {\left( {{Fg} - {Uo}} \right)*{\left( {{Fgr} - {For}} \right)/\left( {{Fg} - {Fo}} \right)}} + {2{{{{\delta \left( {{Fg} - {Uo}} \right)}/\left( {{Fg} - {Fo}} \right)}{{{+ 3}{\delta }}}}}}}} & {{{formula}\quad (17)}\quad}\end{matrix}$

[0131]FIG. 6 is a schematized graph in which only 2|δ(Uo−Fo)/(Fg−Fo)|and 2|δ(Fg−Uo)/(Fg−Fo)| of the formula (16) and the formula (17) arerespectively taken out and Uo is taken as the axis of abscissa and δ istaken as the axis of ordinate.

[0132] In order to minimize the error, it is found from FIG. 6 to begood to use the formula (16) if a value of Uo is smaller than (Fg+Fo)/2and use the formula (17) if not.

[0133] The offset correction formula selection means 11 in the A/Dconversion unit 4 is made to make this selection.

[0134] Also in the case of obtaining Ugr, operation is performed in amanner similar to the case of obtaining Uor. $\begin{matrix}{{Ugr} = {{\left( {{Ug} - {Fo}} \right)*{\left( {{Fgr} - {For}} \right)/\left( {{Fg} - {Fo}} \right)}} + {For} + {3{\delta }} + {2{{{\delta \left( {{Ug} - {Fo}} \right)}/\left( {{Fg} - {Fo}} \right)}}}}} & {{formula}\quad (18)} \\{{Ugr} = {{Fgr} - {\left( {{Fg} - {Ug}} \right)*{\left( {{Fgr} - {Ugr}} \right)/\left( {{Fg} - {Fo}} \right)}} + {3{\delta }} + {2{{{\delta \left( {{Fg} - {Ug}} \right)}/\left( {{Fg} - {Fo}} \right)}}}}} & {{formula}\quad (19)}\end{matrix}$

[0135]FIG. 7 is a schematized graph in which only 2|δ(Ug−Fo)/(Fg−Fo)|and 2|δ(Fg−Ug)/(Fg−Fo)| of the formula (18) and the formula (19) arerespectively taken out and Uo is taken as the axis of abscissa and δ istaken as the axis of ordinate.

[0136] In order to minimize the error, it is found from FIG. 7 to begood to use the formula (18) if a value of Ug is smaller than (Fg+Fo)/2and use the formula (19) if not.

[0137] The gain correction formula selection means 12 in the A/Dconversion unit 4 is made to make this selection.

[0138] Based on the theory described above, a succession destinationunit uses parameters of Uor, Ugr and thereby a slight deviation from Uo,Ug which are parameters of a succession origin is correctedautomatically and an effect similar to the case of calibration manuallyby one channel can be obtained.

[0139] Using a mechanism of the saving and restoration of the user rangedescribed above, the case that plural A/D conversion units are presenton the same system (for example, an FA system) and setting of a useroffset value and a user gain value is copied from one unit of the unitsin which a user offset value and a user gain value are set already tothe other plural units with no setting will be described briefly.

[0140]FIG. 8 is a block diagram of its embodiment. One central controlunit 5 such as a sequencer is prepared and plural A/D conversion unitsare prepared on the same system. In FIG. 8, an A/D conversion unit 4 c(unit C) in which a user range is preset already and A/D conversionunits 4 d, 4 e, 4 f (units D, E, F) with no setting are present on thesame system. A user range is once saved from the unit C to the centralcontrol unit 5 and data of the user range is restored to the units D, Eand F.

[0141]FIG. 9 is a flowchart showing a setting procedure of a user offsetvalue and a user gain value in the system shown in FIG. 8.

[0142] In the flowchart of FIG. 9, in step d1, a user first instructsthe central control unit 5 to make a saving request of user rangesetting from the unit C.

[0143] Next, in step d2, the unit D targeted for restoration is set.Setting of the unit targeted for restoration is allocated on, forexample, the device memory 6 b in the central control unit 5 and is madeby a sequence program. By sequentially updating this unit targeted forrestoration, restoration processing of the plural A/D conversion unitsis performed.

[0144] Then, in step d3, the central control unit 5 is instructed torestore the user range setting saved to the central control unit 5 tothe A/D conversion unit targeted for restoration. An action as shown inthe block diagram (FIG. 8) of user range restoration is performed in theinside of the unit targeted for restoration and the central control unit5 such as the sequencer.

[0145] Then, in step d4, the user checks that one unit is completed froma completion status.

[0146] Then, in step d5, the sequence program decides whether or not allthe units (in this case, the units D, E, F) are set. When there is theunit in which the setting is not processed yet, the flowchart proceedsto step d6 and the unit targeted for restoration is updated. Then,processing from step d3 is again performed with respect to the updatedunit targeted for restoration.

[0147] When the sequence program decides that all the units are set inthe decision in step d5, user range restoration processing is ended.

[0148] A series of processing can be automated by the sequence programof the central control unit 5.

[0149] The system shown in FIG. 8 assumes the case of making the sameuser range setting in large amounts when a set maker mainly mountsplural A/D conversion units to a system of my company product. Incomparison with a conventional procedure of user range setting, userrange setting can be made simultaneously in a batch manner with respectto the plural A/D conversion units, and a reduction in time andlaborsaving of user range setting work can be achieved. This has thelarge effect as the system with a large number of A/D conversion unitsbecomes large.

Second Embodiment

[0150] There is shown an example of the case that one A/D conversionunit is present on an FA system and when this A/D conversion unit isremoved in system operation and is replaced with another A/D conversionunit, user range setting is saved from the another A/D conversion unitbefore the removal and after the removal, the user range setting isrestored when another A/D conversion unit is mounted.

[0151]FIG. 10 shows the system by a block diagram. A central controlunit 5 such as a sequencer and respective A/D conversion units 4targeted for saving and restoration of user range setting are preparedon the same system. In FIG. 10, there is an A/D conversion unit 4 g(unit G) in which a user range is preset already and the unit G isremoved in system operation and is replaced with another A/D conversionunit 4 h (unit H). In that case, data for user range setting present inthe unit G is saved to the central control unit 5 and is restored at thetime of mounting the unit H.

[0152]FIG. 11 is a flowchart showing a replacement procedure from theunit G to the unit H in system operation in this embodiment.

[0153] In the flowchart of FIG. 11, in step e1, a user first instructsthe central control unit 5 to make a saving request of user rangesetting of the unit G.

[0154] By this processing, the user range setting set in the unit G issaved to the central control unit 5.

[0155] Next, in step e2, the user instructs the central control unit 5to replace the unit G.

[0156] Then, in step e3, the unit G receives instructions of the unitreplacement to stop operation and informs the central control unit 5 ofa unit removal OK status. The unit G stops operation in this stage inpreparation for removal of the next step.

[0157] Then, in step e4, the user receives the unit removal OK statusreturning to the central control unit 5 such as the sequencer.

[0158] Thereafter, the user detaches external wiring of the unit G andremoves the unit G itself (step e5), and then mounts the unit H to thesystem and performs external wiring of the unit H (step e6) . Further,the central control unit 5 is instructed to make a unit mounting (unitstarting) request of the unit H (step e7).

[0159] Then, in step e8, the unit H waits A/D conversion processinguntil a rise control start request is issued from the central controlunit 5 in a wait state.

[0160] Then, in step e9, the user instructs the central control unit 5to make a range setting restoration request to the unit H mounting userrange setting data in which the saving request is made from the unit Gafter checking a rise in step e8.

[0161] By this processing, the unit H completes the user range setting.Then, in step e10, the unit H receives a user range setting restorationrequest from the central control unit 5 and performs restoration.

[0162] Then, in step e11, the user instructs the unit H to start controlvia the central control unit 5.

[0163] Finally, in step e12, the unit H receives a control start requestfrom the user via the central control unit 5 and starts the A/Dconversion processing.

[0164] In this embodiment, for example, the case that a field useractually using the FA system including the A/D conversion unit replacesonly the particular A/D conversion unit without stopping the entiresystem is assumed. In comparison with a conventional procedure of userrange setting, there is no need to stop the entire system, so thatoperating efficiency of the entire FA system can be increased.

Third Embodiment

[0165] There is shown an embodiment in which, for example, plural A/Dconversion units are present on an FA system and range setting isswitched according to the case without stopping the entire FA system andoperation can instantaneously be performed.

[0166]FIG. 12 shows the system by a block diagram.

[0167] A central control unit 5 and plural A/D conversion units 4 j, 4k, 4 l (units J, K, L) targeted for saving and restoration of user rangesetting are prepared on the same system. In this embodiment, data ofinput ranges from a case 1 to a case n is previously held in devicememory 6 b. This data of input ranges is stored in the units J, K, Lpresent on the system to perform operation.

[0168] Data of input ranges which are not set on standards is prepared,for example, an input range of −1 to 10 V is used in a case 1 and aninput range of −1 to 5 V is used in a case 2, and the data is set to theA/D conversion units immediately before use.

[0169] In a conventional method, every time, the entire system isstopped and setting of an offset value and a gain value is made orswitching is performed only within the input ranges held in each of theA/D conversion units to make use and on the contrary, in a method ofthis embodiment, the device memory 6 b in the central control unit 5such as a sequencer can be used as storage means of data. As a result ofthis, data of multiple input ranges can be preserved and switched. Also,simultaneous batch setting of data of input ranges with respect to theplural A/D conversion units can be made.

Industrial Applicability

[0170] As described above, an analog unit system according to thisinvention is suitable for use in cases etc. for replacing only a desiredanalog unit in an FA system etc. into which multiple analog units areincorporated.

1. An analog unit system characterized by comprising: a first analogunit having first storage means for storing a first factory settingvalue and a first user setting value; and second storage means forreading the first factory setting value and the first user setting valueout of the first storage means and storing the setting values.
 2. Ananalog unit system characterized by comprising: a first analog unithaving first storage means for storing a first factory setting value anda first user setting value; second storage means for reading the firstfactory setting value and the first user setting value out of the firststorage means and storing the setting values; operation means forcalculating a second user setting value based on the first factorysetting value and the first user setting value read out of the secondstorage means; and a second analog unit having third storage means forstoring the second user setting value calculated by this operationmeans.
 3. An analog unit system as claimed in claim 2, characterized inthat there are a plurality of second analog units and a second usersetting value is supplied to this plurality of second analog units in abatch manner.